home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / util / wb / DosMan121.lha / man / Search < prev    next >
Text File  |  1995-04-03  |  6KB  |  151 lines

  1.  
  2.  
  3.  
  4.      Search(V1.3)  
  5.  
  6.  
  7.      NAME
  8.           Search - Search a file or files for a name or pattern.
  9.  
  10.      SYNOPSIS
  11.           1.3:
  12.           Search [From name] [Search string] ALL [NONUM] [QUIET]
  13.                  [QUICK] [FILE] 
  14.           
  15.           2.x/3.x:
  16.           Search [From name] [Search string] ALL [NONUM] [QUIET]
  17.                  [QUICK] [FILE] [PATTERN]
  18.  
  19.      DESCRIPTION
  20.             Use Search to hunt for patterns or strings in files.  
  21.         As usual, you can specify the files using a wildcard 
  22.         pattern, and you can also specify a directory to be 
  23.         searched.  Search also allows itself to be used in the 
  24.         middle of a pipeline.  To do this, you must use the 
  25.         filename STDIN, and it must be spelled in UPPER CASE.
  26.  
  27.             Under 2.x/3.x's Search also allows you to specify a 
  28.         wildcard pattern as the search string, which the 1.3 
  29.         version still does not.  Any valid AmigaDOS pattern may 
  30.         be used as the search string.
  31.  
  32.             If a search object is found, then Search will return 
  33.         0, otherwise it will return with the WARN faillevel set.  
  34.         This makes Search usable in scripts (see also QUIET, 
  35.         below).
  36.  
  37.             When searching through more than one file at a time, 
  38.         you can use C-e or C-f (Control E or Control F) to 
  39.         abandon the current file and move on to the next. (NOTE: 
  40.         This is different from the Commodore BCPL search, which 
  41.         uses C-d (Control d).  Using C-e and C-f prevents 
  42.         conflicts with using C-d in script files, since C-d will 
  43.         abort a script file.)  As usual, to kill the program, use 
  44.         C-c (Control C).
  45.  
  46.             Search treats the carriage return character as the 
  47.         end of the line. It also only searches the first 205 
  48.         characters of a line, if there are more characters than 
  49.         that then the you are warned with a 'LINE n truncated' (n 
  50.         being the line number) and the search continuing.
  51.           
  52.             2.x/3.x's Search places the last pattern you used in 
  53.         an environment variable called "Search".  If you reuse 
  54.         Search at a later time, and omit the search string, 
  55.         Search will use the value of this Environment variable. 
  56.         This is convenient when searching for complex patterns 
  57.         over and over again on different disks or directories.  
  58.         This is also available to other programs to use if 
  59.         desired.
  60.  
  61.             KEYWORDS
  62.           ALL
  63.             Recursively descend all directories in the specified 
  64.         branch of the directory tree, searching each file for the 
  65.         pattern specified.
  66.  
  67.           NONUM
  68.             Do not display line numbers.  This option will also 
  69.         kill the indent Search usually adds to the lines it 
  70.         displays. Not used before 1.3.
  71.  
  72.           FROM name
  73.             The file or directory to be searched. 'name' can also 
  74.         be an AmigaDOS pattern if using 2.x/3.x. If this is the 
  75.         first argument in your SEARCH, then this keyword is 
  76.         optional.
  77.  
  78.           SEARCH or NAME string
  79.             This is the string of text you will look for. If this 
  80.         is your second argument then the keyword is optional. if 
  81.         there are any spaces in your string, there must be quotes 
  82.         around it. The string is not case sensitive, so if you 
  83.         search for HIM then him, Him, HiM, or hIm, etc. Under 
  84.         2.x/3.x you can use NAME instead of SEARCH and the exact 
  85.         same result will occur.
  86.  
  87.           QUIET
  88.             Search without displaying found lines.  This is 
  89.         useful when you only want to get the return code from 
  90.         Search (for example, in a script file).
  91.  
  92.           QUICK
  93.             This causes Search to use a more compact output 
  94.         format to speed up display.  NOTE - when using SEARCH 
  95.         from an interactive CLI, this is the DEFAULT.
  96.  
  97.           FILE
  98.             This causes Search to hunt for a file of the 
  99.         specified name, rather than searching through the 
  100.         contents of the files. Under 2.x/3.x the full path is 
  101.         printed. This makes it extremely easy to find a 
  102.         particular file on a large volume.
  103.  
  104.           CASE 
  105.             This causes Search to consider case as important in 
  106.         comparing search patterns. Ordinarily, case is ignored 
  107.         during a search.
  108.  
  109.           PATTERN
  110.             An optional keyword under 2.x/3.x only. It tells the 
  111.         CLI that a pattern will be used during the search.
  112.  
  113.  
  114.         EXAMPLES
  115.           
  116.         1.This command line demonstrates the use of wildcard
  117.           patterns in both the FROM and the SEARCH string positions.
  118.           This will cause Search to look at all files in
  119.           SYS:INCLUDE/exec which end with the characters '#?.h', for
  120.           all strings which begin with the three characters 'SIG',
  121.           followed by any character, followed by an underscore,
  122.           followed by anything:
  123.  
  124.  
  125.  
  126.                 Search SYS:INCLUDE/exec/#?.h SIG?_#?
  127.  
  128.  
  129.  
  130.         2.To Search all the files in a directory called Westerns/TNT
  131.           and all the files within its subdirectories for the phrase
  132.           'speghetti westerns':
  133.  
  134.  
  135.                 Search Westerns/TNT "speghetti westerns' ALL 
  136.  
  137.  
  138.         3.Look inside the file AmigaJokes for the work IrvingGould:
  139.  
  140.             
  141.                 Search AmigaJokes IrvingGould
  142.  
  143.  
  144.         4.Search Quickly all the files which end in .txt in the 
  145.           current dir for the phrase 'super model' and print them.
  146.  
  147.  
  148.                 Search > PRT: #?.txt "super models" QUICK
  149.  
  150.  
  151.